import request from '@/utils/request'


// 查询所有人才相关证件信息详细
//id为人才id
export function getDocumentList(id) {
  return request({
    url: '/talent/document/list/' + id,
    method: 'get'
  })
}

//查询单条证件信息详细
//id为证件id
export function getDocument(id) {
  return request({
    url: '/talent/document/' + id,
    method: 'get'
  })
}

// 查询证件附件
export function getAttachment(id) {
  return request({
    url: '/talent/document/attachment/' + id,
    method: 'get'
  })
}



// 新增证件信息
export function addDocument(data) {
  return request({
    url: '/talent/document/add',
    method: 'post',
    data: data
  })
}

// 修改证件信息
export function updateDocument(data) {
  return request({
    url: '/talent/document/update',
    method: 'put',
    data: data
  })
}

// 删除证件信息
export function delDocument(id) {
  return request({
    url: '/talent/document/' + id,
    method: 'delete'
  })
}

//上传证件附件
export function uploadAttachment(data) {
  return request({
    url: 'attach/upload',
    method: 'post',
     headers: {
      'Content-Type': 'multipart/form-data',  // 明确指定Content-Type为multipart/form-data
    },
    data: data
  })
}
